package testWater.entity;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.io.Serializable;

/**
 * @author water
 * @date 2020-11-02
 */
@Entity
@Data
@Table(name="test2")
public class TestWater implements Serializable {


    @Id
    @Column(name = "id")
    @CreationTimestamp
    private Long id;


    @Column(name = "name")
    @CreationTimestamp
    private String name;

    public void copy(TestWater source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
